<?php
/**
 *  中继
 *
 * 
 */
 namespace OM\Dev;


 class Trunk
 {

 	const TRUNK_OFFLINE = 0;
 	const TRUNK_UNWIRED  = 1;
 	const TRUNK_IDLE    = 1;
 	const TRUNK_BUSY    = 2;

 	const TRUNK_READY   = 1;
 	const TRUNK_ACTIVE  = 2;
 	const TRUNK_PROGRESS = 2;

 	protected $m_id = ''; // 中继（外线）号
 	protected $m_lineid = ''; //中继的线路编号，是中继的唯一固定标识
 	/**
 	 *  ready: 可用
	 *	active: 摘机、振铃或通话中
	 *	unwired:未接线
	 *	offline:离线  
 	 */
 	protected $m_state = ''; // 中继的线路状态
 	protected $m_outer = null;
 	protected $m_visitor = null;


 	public function __construct(  )
 	{
 		$this->m_state = self::TRUNK_READY ; 
 	}

 	public function __set($n,$v) { 
		$var = 'm_'.$n;
		if( !isset( $this->$var ) )
			return false;
		else
			return $this->$var = $v; 
	}

	public function __get($name) { 
		$var = 'm_'.$name;
		if( !isset( $this->$var ) )
			return false;
		else
			return $this->$var; 
	}
 }
?>